ARG FRONT_VERSION=latest
FROM registry.xuelangyun.com/shuzhi-amd64/sh_node_emulation_front:$FRONT_VERSION as front_page

# FROM registry.xuelangyun.com/shuzhi/sh-sim-component:5 as backend
# FROM node:20 as backend

# WORKDIR /code
# COPY . ./
# RUN npm --registry http://registry.npm.taobao.org install --production && \
#     npm run build

# FROM registry.xuelangyun.com/shuzhi/sh-sim-component:5
FROM node:20

RUN rm -f /etc/localtime \
&& ln -sv /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
&& echo "Asia/Shanghai" > /etc/timezone

WORKDIR /app
COPY package.json ./
RUN npm --registry http://registry.npm.taobao.org install --production
# COPY --from=backend /code/dist ./
COPY ./dist ./
COPY --from=front_page /home/suanpan/web/dist ./common/statics

CMD [ "bash" ]
